package com.woniu.core.controller;


import com.woniu.core.service.CoreRecommendationRecordService;
import com.woniu.platform.entity.PlatformRecommendationRecord;
import com.woniu.util.utils.HttpResult;
import com.woniu.util.utils.RequestResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/CoreRecommendationRecord")
public class CoreRecommendationRecordController {
    @Autowired
    private CoreRecommendationRecordService coreRecommendationRecordService;



    /**
     * 新增推荐记录
     * @param coreId 核心企业id
     * @param enterpriseName  融资企业名称
     * @return
     */
    @GetMapping("/insertCoreRecommendationRecord")
    public HttpResult<?> insertCoreRecommendationRecord(String coreId, String enterpriseName){
        return coreRecommendationRecordService.addCoreRecommendationRecord(coreId,enterpriseName);
    }

    /**
     * 根据核心企业id查询平台推荐的融资企业
     * @param requestResult
     * @return
     */
    @PostMapping("/selectRecommendationByCoreId")
    public HttpResult<?> selectRecommendationByCoreId(@RequestBody RequestResult<PlatformRecommendationRecord> requestResult){
        return coreRecommendationRecordService.selectRecommendationByCoreId(requestResult);
    }




}
